[IA64] Create NVRAM save directory
authorAlex Williamson <alex.williamson@hp.com>
Fri, 15 Jun 2007 15:25:09 +0000 (09:25 -0600)
committerAlex Williamson <alex.williamson@hp.com>
Fri, 15 Jun 2007 15:25:09 +0000 (09:25 -0600)
If you use RPM to install XEN, the directory(/usr/lib/xen/boot)
will be removed when you un-install the RPM. This patch create
that directory before NVRAM file creating.

Signed-off-by: Zhang Xin <xing.z.zhang@intel.com>
tools/libxc/ia64/xc_ia64_hvm_build.c

index a3872f2aecb548ce546ce8f2427a6d7c44c75407..228becc3e8c47fa42d54e02e60e8791c688e2f1e 100644 (file)
@@ -735,6 +735,7 @@ int xc_ia64_save_to_nvram(int xc_handle, uint32_t dom)
     return 0;
 }
 
+#define NVRAM_DIR       "/usr/lib/xen/boot/"
 #define NVRAM_FILE_PATH        "/usr/lib/xen/boot/nvram_"
 int xc_ia64_nvram_init(int xc_handle, char *dom_name, uint32_t dom)
 {
@@ -749,6 +750,7 @@ int xc_ia64_nvram_init(int xc_handle, char *dom_name, uint32_t dom)
         return -1;
     }
     strcpy(nvram_path + file_path_len, dom_name);
+    mkdir(NVRAM_DIR, 0765);
 
     nvram_fd = nvram_init(nvram_path);
     if ( nvram_fd == (uint64_t)(-1) )